.class public abstract Lcom/snowplowanalytics/snowplow/tracker/events/AbstractEvent;
.super Ljava/lang/Object;

# interfaces
.implements Lcom/snowplowanalytics/snowplow/tracker/events/Event;


# instance fields
.field private final context:Ljava/util/List;

.field protected deviceCreatedTimestamp:J

.field private final eventId:Ljava/lang/String;

.field private trueTimestamp:Ljava/lang/Long;


# direct methods
.method constructor <init>(Lcom/snowplowanalytics/snowplow/tracker/events/AbstractEvent$Builder;)V
    .locals 2

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    # getter for: Lcom/snowplowanalytics/snowplow/tracker/events/AbstractEvent$Builder;->context:Ljava/util/List;
    invoke-static {p1}, Lcom/snowplowanalytics/snowplow/tracker/events/AbstractEvent$Builder;->access$000(Lcom/snowplowanalytics/snowplow/tracker/events/AbstractEvent$Builder;)Ljava/util/List;

    move-result-object v0

    invoke-static {v0}, Lcom/snowplowanalytics/snowplow/tracker/utils/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;

    # getter for: Lcom/snowplowanalytics/snowplow/tracker/events/AbstractEvent$Builder;->eventId:Ljava/lang/String;
    invoke-static {p1}, Lcom/snowplowanalytics/snowplow/tracker/events/AbstractEvent$Builder;->access$100(Lcom/snowplowanalytics/snowplow/tracker/events/AbstractEvent$Builder;)Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lcom/snowplowanalytics/snowplow/tracker/utils/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;

    # getter for: Lcom/snowplowanalytics/snowplow/tracker/events/AbstractEvent$Builder;->eventId:Ljava/lang/String;
    invoke-static {p1}, Lcom/snowplowanalytics/snowplow/tracker/events/AbstractEvent$Builder;->access$100(Lcom/snowplowanalytics/snowplow/tracker/events/AbstractEvent$Builder;)Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/String;->isEmpty()Z

    move-result v0

    if-nez v0, :cond_0

    const/4 v0, 0x1

    :goto_0
    const-string v1, "eventId cannot be empty"

    invoke-static {v0, v1}, Lcom/snowplowanalytics/snowplow/tracker/utils/Preconditions;->checkArgument(ZLjava/lang/Object;)V

    # getter for: Lcom/snowplowanalytics/snowplow/tracker/events/AbstractEvent$Builder;->context:Ljava/util/List;
    invoke-static {p1}, Lcom/snowplowanalytics/snowplow/tracker/events/AbstractEvent$Builder;->access$000(Lcom/snowplowanalytics/snowplow/tracker/events/AbstractEvent$Builder;)Ljava/util/List;

    move-result-object v0

    iput-object v0, p0, Lcom/snowplowanalytics/snowplow/tracker/events/AbstractEvent;->context:Ljava/util/List;

    # getter for: Lcom/snowplowanalytics/snowplow/tracker/events/AbstractEvent$Builder;->deviceCreatedTimestamp:J
    invoke-static {p1}, Lcom/snowplowanalytics/snowplow/tracker/events/AbstractEvent$Builder;->access$200(Lcom/snowplowanalytics/snowplow/tracker/events/AbstractEvent$Builder;)J

    move-result-wide v0

    iput-wide v0, p0, Lcom/snowplowanalytics/snowplow/tracker/events/AbstractEvent;->deviceCreatedTimestamp:J

    # getter for: Lcom/snowplowanalytics/snowplow/tracker/events/AbstractEvent$Builder;->trueTimestamp:Ljava/lang/Long;
    invoke-static {p1}, Lcom/snowplowanalytics/snowplow/tracker/events/AbstractEvent$Builder;->access$300(Lcom/snowplowanalytics/snowplow/tracker/events/AbstractEvent$Builder;)Ljava/lang/Long;

    move-result-object v0

    iput-object v0, p0, Lcom/snowplowanalytics/snowplow/tracker/events/AbstractEvent;->trueTimestamp:Ljava/lang/Long;

    # getter for: Lcom/snowplowanalytics/snowplow/tracker/events/AbstractEvent$Builder;->eventId:Ljava/lang/String;
    invoke-static {p1}, Lcom/snowplowanalytics/snowplow/tracker/events/AbstractEvent$Builder;->access$100(Lcom/snowplowanalytics/snowplow/tracker/events/AbstractEvent$Builder;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/snowplowanalytics/snowplow/tracker/events/AbstractEvent;->eventId:Ljava/lang/String;

    return-void

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method


# virtual methods
.method public getContext()Ljava/util/List;
    .locals 2

    new-instance v0, Ljava/util/ArrayList;

    iget-object v1, p0, Lcom/snowplowanalytics/snowplow/tracker/events/AbstractEvent;->context:Ljava/util/List;

    invoke-direct {v0, v1}, Ljava/util/ArrayList;-><init>(Ljava/util/Collection;)V

    return-object v0
.end method

.method public getDeviceCreatedTimestamp()J
    .locals 2

    iget-wide v0, p0, Lcom/snowplowanalytics/snowplow/tracker/events/AbstractEvent;->deviceCreatedTimestamp:J

    return-wide v0
.end method

.method public getEventId()Ljava/lang/String;
    .locals 1

    iget-object v0, p0, Lcom/snowplowanalytics/snowplow/tracker/events/AbstractEvent;->eventId:Ljava/lang/String;

    return-object v0
.end method

.method public abstract getPayload()Lcom/snowplowanalytics/snowplow/tracker/payload/Payload;
.end method

.method public getTrueTimestamp()J
    .locals 2

    iget-object v0, p0, Lcom/snowplowanalytics/snowplow/tracker/events/AbstractEvent;->trueTimestamp:Ljava/lang/Long;

    invoke-virtual {v0}, Ljava/lang/Long;->longValue()J

    move-result-wide v0

    return-wide v0
.end method

.method putDefaultParams(Lcom/snowplowanalytics/snowplow/tracker/payload/TrackerPayload;)Lcom/snowplowanalytics/snowplow/tracker/payload/TrackerPayload;
    .locals 4

    const-string v0, "eid"

    invoke-virtual {p0}, Lcom/snowplowanalytics/snowplow/tracker/events/AbstractEvent;->getEventId()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {p1, v0, v1}, Lcom/snowplowanalytics/snowplow/tracker/payload/TrackerPayload;->add(Ljava/lang/String;Ljava/lang/String;)V

    const-string v0, "dtm"

    invoke-virtual {p0}, Lcom/snowplowanalytics/snowplow/tracker/events/AbstractEvent;->getDeviceCreatedTimestamp()J

    move-result-wide v2

    invoke-static {v2, v3}, Ljava/lang/Long;->toString(J)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {p1, v0, v1}, Lcom/snowplowanalytics/snowplow/tracker/payload/TrackerPayload;->add(Ljava/lang/String;Ljava/lang/String;)V

    iget-object v0, p0, Lcom/snowplowanalytics/snowplow/tracker/events/AbstractEvent;->trueTimestamp:Ljava/lang/Long;

    if-eqz v0, :cond_0

    const-string v0, "ttm"

    invoke-virtual {p0}, Lcom/snowplowanalytics/snowplow/tracker/events/AbstractEvent;->getTrueTimestamp()J

    move-result-wide v2

    invoke-static {v2, v3}, Ljava/lang/Long;->toString(J)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {p1, v0, v1}, Lcom/snowplowanalytics/snowplow/tracker/payload/TrackerPayload;->add(Ljava/lang/String;Ljava/lang/String;)V

    :cond_0
    return-object p1
.end method
